package com.corpgovernment.organization.enumm.budget;

import java.util.LinkedHashMap;
import java.util.Map;

public enum BudgetOperationEnum {

    ADD("1", "新增"),
    UPDATE("2", "编辑");

    private String code;
    private String desc;

    BudgetOperationEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    private static Map<String, BudgetOperationEnum> codeMap = new LinkedHashMap<>();

    static {
        for (BudgetOperationEnum budgetChangeEnum : BudgetOperationEnum.values()) {
            codeMap.put(budgetChangeEnum.getCode(), budgetChangeEnum);
        }
    }

    public static BudgetOperationEnum getEnumByCode(String code) {
        return codeMap.get(code);
    }
}